'''
Created on Jun 22, 2009

@author: morales
'''

import numpy.matlib as np
import msTools

DEBUG = False     
    
def getSiteFrequencySpectrum( data ):
    P = np.matrix( data )
    
    n = P.shape[0]
    S = P.shape[1]
    
    sums = np.ravel(P.sum(axis=0))
    SFS = np.ravel( np.zeros(n, int) )
    
    for cItr in range(S):
        k = sums[cItr]
        SFS[k] = SFS[k] + 1
        
    return SFS
